package util;

import entity.CaseHistory;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Author:
 * @Date: 2020-04-22
 * @Description: @PACKAGE:util
 * @version: 1.0
 */
public class CaseHistoryRowMapper implements RowMapper<CaseHistory> {
    @Override
    public CaseHistory getRow(ResultSet resultSet) {
        CaseHistory caseHistory = new CaseHistory();
        //在结果集里拿数据，进行对象的赋值
        try {
            caseHistory.setCh_number(resultSet.getString(1));
            caseHistory.setCh_date(resultSet.getString(2));
            caseHistory.setCh_updateDate(resultSet.getString(3));
            caseHistory.setCh_doctorid(resultSet.getString(4));
            caseHistory.setCh_patientid(resultSet.getString(5));
            caseHistory.setCh_symptom(resultSet.getString(6));
            caseHistory.setCh_checkitem(resultSet.getString(7));
            caseHistory.setCh_result(resultSet.getString(8));
            caseHistory.setCh_clinicaldiagnosis(resultSet.getString(9));
            caseHistory.setCh_plan(resultSet.getString(10));
            caseHistory.setCh_druglist(resultSet.getString(11));
            caseHistory.setCh_advice(resultSet.getString(12));
            caseHistory.setCh_Degree_symptoms(resultSet.getString(13));

        } catch (SQLException e) {
            e.printStackTrace();
        }

        return caseHistory;
    }
}
